package chapter13;
public class Square extends GeometricObject {
    private double width;


    public Square() {
    }

    public Square(double width) {
        this.width = width;
    }

    /**
     * Return width
     */
    public double getWidth() {
        return width;
    }

    /**
     * Set a new width
     */
    public void setWidth(double width) {
        this.width = width;
    }


    @Override
    /** Return area */
    public double getArea() {
        return width * width;
    }

    @Override
    /** Return perimeter */
    public double getPerimeter() {
        return 2 * (width + width);
    }

}